<?php
//自动加载类机制
class AutoLoader {
    public static function load(){
        spl_autoload_register(array(self::class, 'loadClass'));
    }
    //自动加载类
    static function loadClass($class)
    {
        $class_bak = $class;
        $class = explode('\\', $class);
        if ($class[0] == 'app') {
            $class[0] = APPLICATION_NAME;
        }
        $file = APP_PATH . implode('/', $class) . ".php";
        if (file_exists($file)) {
            require_once $file;
        }
    }
}